<style scoped></style>

<template>
  <el-carousel trigger="click" height="300">
    <el-carousel-item v-for="item in img_list" :key="item.id">
      <!-- <el-image :src="item.url"></el-image> -->
      <img :src="item.url" />
    </el-carousel-item>
  </el-carousel>
</template>

<script setup>
import { ref, onMounted } from 'vue';
import request from '../../../utils/axios';
let img_list = ref([]);

onMounted(async (cb) => {
  //解构
  await request({
    // 请求地址
    url: 'http://website.bluej.cn/api/carouselGroup/get',
    // 请求方式
    method: 'GET',
    //get的参数
    params: {
      carouselGroupId: 1277,
    },
  }).then((res) => {
    img_list.value = res.data.Carousels;
  });
});
</script>
